/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jefoutta
 */
public class ContextSwitch {
    private boolean temp = false;
    private Registries reg;

    public boolean run(Integer id1, Integer id2){

        if(id1 != null){
                Memory.pushMemory(id1);
                Registries.pushRegistries(id1);
            }
        if(Memory.memory_stack.containsKey(id2)){
            Memory.popMemory(id2);
                Registries.popRegistries(id2);
                temp = true;
            }else{
             temp = false;
            }
        return temp;
    }
}
